#coding:utf-8

import tornado.web
import tornado.gen
import tornado.ioloop

import settings
import live
import api

routings = [(r"/api/room/(\w+)/dm/$", api.SendDmHandler)]

if settings.LIVE_WS_ENABLED:
    routings.append((r"/live/ws/(\w+)/$", live.LiveWsHandler))
if settings.LIVE_POLL_ENABLED:
    routings.append((r"/live/poll/(\w+)/$", live.LivePollHandler))

if __name__ == "__main__":

    app = tornado.web.Application(routings)

    app.listen(8887)

    tornado.ioloop.IOLoop.current().start()